cmake_minimum_required(VERSION 3.10.2)
project(svcFwk)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1y -fno-rtti -fvisibility=default -D_GNU_SOURCE")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdata-sections -fPIC -fpic -ffunction-sections -D_GLIBC_MOCK")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,--no-as-needed -ldl")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wformat=0 -fpermissive")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fprofile-arcs -ftest-coverage")
set(MOCK_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../../mock")
set(KV_STORE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../../kv_store")
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/backuprule svcFwkSrc)
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/checker svcFwkSrc)
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/metadata svcFwkSrc)
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/eventcenter svcFwkSrc)
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/serializable svcFwkSrc)
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/feature svcFwkSrc)
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/directory svcFwkSrc)
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/store svcFwkSrc)
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/cloud svcFwkSrc)
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/utils svcFwkSrc)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../adapter/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../../utils_native/base/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../../utils_native/safwk/native/include)
include(${MOCK_DIR}/include/CMakeLists.txt OPTIONAL)
include(${KV_STORE_DIR}/interfaces/CMakeLists.txt OPTIONAL)

set(links secure mock crypto)
set(LIBRARY_OUTPUT_PATH "${PROJECT_BINARY_DIR}/../../../../")
add_library(svcFwk SHARED ${svcFwkSrc} metadata/matrix_meta_data.cpp include/metadata/matrix_meta_data.h)
target_link_libraries(svcFwk ${links})
